package com.qf.service.impl;

import com.qf.dao.UserDao;
import com.qf.dao.impl.UserDaoImpl;
import com.qf.model.User;
import com.qf.service.UserService;

public class UserServiceImpl  implements UserService {
    UserDao dao=new UserDaoImpl();
    @Override
    public int checkUsername(String username) {
        User u=dao.SelectUserByUsername(username);
        if(u==null){
            return 0;
        }else{

            return 1;
        }
    }

    @Override
    public int register(User u) {
        return dao.insertUser(u);
    }
}
